import http from '@/utils/request'

import IBaseObj from '#/index'

export const getGlobalGroups = () =>
  http({
    url: '/group/global',
    method: 'get',
  })

export const getGroupListByPid = (pid: string) =>
  http({
    url: `/group/list/pi/${pid}`,
    method: 'get',
  })

const getGroupByPage = (data: IBaseObj) =>
  http({
    url: `/group/page`,
    method: 'post',
    data,
  })

const saveGroup = (data: IBaseObj) =>
  http({
    url: `/group/save`,
    method: 'post',
    data,
  })

const delUrl = '/group'

export default {
  getGlobalGroups,
  getGroupByPage,
  saveGroup,
  delUrl,
}
